/*
  学习目标：static关键字的使用
*/

import React, { Component } from 'react';
import PropTypes from 'prop-types';

export default class App extends Component {
  render() {
    return (
      <div>
        <Child title={<h1>123</h1>} />
      </div>
    );
  }
}

class Child extends React.Component {
  // static :将一个实例成员变为静态成员
  static propTypes = {
    name: PropTypes.number.isRequired,
    title: PropTypes.element,
  };

  static defaultProps = {
    name: 30,
  };

  render() {
    return <div>{this.props.name}</div>;
  }
}
